<template>
  <div>
    <div class="head">
      <span>商家管理系统</span>
    </div>
    <div class="left">
      <div class="home">
        <router-link icon="el-icon-s-home" active-class="active" to="/Welcome">
          <button class="btn">首 页</button>
        </router-link>
      </div>
      <div class="L_goods">
        <router-link active-class="active" to="/Goods">
          <button class="btn">商品管理</button>
        </router-link>
      </div>
      <div class="L_order">
        <button class="btn">
          <router-link active-class="active" tag="div" to="/order">订单管理</router-link>
        </button>
      </div>
      <button tag="button" id="out" @click="outLogin">退出登录</button>
    </div>

<!--    注释是因为会出现双页面问题 (冯泽嘉) ，注释完之后问题得以解决-->
<!--    <router-view></router-view>-->
  </div>
</template>

<script>
  export default {
    name: "Left",
    data(){
      return{

      }
    },
    methods: {
      outLogin() {
        this.$message.success("退出登录成功");
        this.$router.replace('/');
        //清除token和merchant对象
        this.$store.commit('REMOVE_INFO');
      },
    }

  }
</script>

<style scoped>
  .head {
    position: absolute;
    width: 1535px;
    line-height: 100px;
    top: 0px;
    left: 0px;
    right: 0px;
    background-color: rgb(240, 202, 99);

    color: black;
    font-size: 70px;
    font-family: 微软雅黑;
  }

  .left {
    position: absolute;
    width: 170px;
    top: 100px; /* 距离上面100像素 */
    left: 0px;
    bottom: 0px;

    /* 当内容过多时y轴出现滚动条 */
    /* overflow-y: auto;  */
    background-color: rgb(245, 212, 142);

    color: black;

    font-size: 30px;
  }

  .home {
    position: absolute;
    width: 170px;
    height: 100px;
    top: 0px;
    left: 0px;
    text-align: center;
    line-height: 100px;
    /* background-color: blue; */
    padding: 0px;
    border: 1px solid wheat;

  }

  .L_goods {

    position: absolute;
    width: 170px;
    height: 100px;
    top: 100px;
    left: 0px;
    text-align: center;
    line-height: 100px;
    /* background-color: blue; */
    padding: 0px;
    border: 1px solid wheat;
    /* > div{
        display:flex;
        align-items:center;
    } */


  }

  .L_order {
    position: absolute;
    width: 170px;
    height: 100px;
    top: 200px;
    left: 0px;
    /* background-color: blue; */
    border: 1px solid wheat;
    text-align: center;
    line-height: 100px;
  }

  .btn {
    width: 170px;
    height: 100px;
    border: 1px solid wheat;
    background-color: rgb(245, 212, 142);
    font-size: 30px;
  }

  #out {
    position: absolute;
    width: 170px;
    height: 100px;
    top: 300px;
    left: 0px;
    /* background-color: blue; */
    border: 1px solid wheat;
    text-align: center;
    line-height: 100px;
    background-color: rgb(245, 212, 142);
    font-size: 30px;
  }

</style>
